package com.gongpingjialoan.utility;


import android.content.Context;
import android.text.TextUtils;
import android.util.AttributeSet;

import com.android.volley.toolbox.ImageLoader;
import com.android.volley.toolbox.NetworkImageView;
import com.gongpingjialoan.R;

public class NetworkImageView2 extends NetworkImageView {

	/**
	 * 默认构造函数
	 * @param context
	 */
	public NetworkImageView2(Context context){
		super(context);
	}
	/**
	 * 该构造方法在静态引入XML文件中是必须的
	 * @param context
	 * @param paramAttributeSet
	 */
	public NetworkImageView2(Context context,AttributeSet paramAttributeSet){
		super(context,paramAttributeSet);  
	}

	@Override
	public void setImageUrl(String url, ImageLoader imageLoader) {
		this.setDefaultImageResId(R.drawable.car_loading);
		this.setErrorImageResId(R.drawable.car_no);
		String realUrl = null;
		if(TextUtils.isEmpty(url)){
			realUrl = "";
		}else{
			realUrl = url;
		}
		super.setImageUrl(realUrl, imageLoader);
	}

}
